package com.iweb.service;

import com.iweb.mapper.OrderGMapper;
import com.iweb.model.OrderG;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Time :2022/8/16 8:41
 * Author : kriller
 * Project : steam-malls
 */
@Service
public class OrderGservice {
    @Resource
    private OrderGMapper orderGMapper;

    public void insertNewOrder(OrderG orderG) {
        orderGMapper.insertOrderG(orderG);
    }

    public void updateStateForPayById(Long orderGId) {
        orderGMapper.updatePayState(orderGId);
    }

    public void updateStateForRefundById(Long orderGId) {
        orderGMapper.updateRefundState(orderGId);
    }

    public List<OrderG> listUserOrderG(Integer userId) {

        List<OrderG> orderGS = orderGMapper.selectByUserId(userId);
        return orderGS;
    }
}
